//
//  CellBean.m
//  iiecg
//
//  Created by Shanlin on 2017/3/2.
//  Copyright © 2017年 Boundary Technology. All rights reserved.
//

#import "CellBean.h"

@implementation CellBean

- (CGFloat) heightForString:(NSString *)value fontSize:(CGFloat)fontSize andWidth:(CGFloat)width{
    NSDictionary *attribute = @{NSFontAttributeName: [UIFont systemFontOfSize:fontSize]};
    CGSize size= [value boundingRectWithSize:CGSizeMake(width, 0) options:NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:attribute context:nil].size;
    return size.height + 10;
}

-(CGFloat) widthForString:(NSString *)value fontSize:(CGFloat)fontSize
{
    NSDictionary *attribute = @{NSFontAttributeName: [UIFont systemFontOfSize:fontSize]};
    CGSize size= [value boundingRectWithSize:CGSizeMake(KScreenW, 0) options:NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:attribute context:nil].size;
    return size.width + 4;
    
}

@end
